package com.zto.sch.base.jvm;

import lombok.Data;

import java.util.HashMap;
import java.util.TreeMap;
import java.util.concurrent.Executors;

/**
 * @program: sch-diy-parent
 * @description:
 * @author: sch
 * @create: 2021-01-17 18:08
 **/
@Data
public class MyCloneable implements Cloneable {
    Person person;
    long count;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public static void main(String[] args) throws CloneNotSupportedException {
        MyCloneable myCloneable = new MyCloneable();
        Person person = Person.builder().name("xiaoqiang")
                .age(18)
                .city(new City("上海", 1)).build();
        myCloneable.person = person;
        myCloneable.setCount(1000);

        MyCloneable clone = (MyCloneable) myCloneable.clone();
        System.out.println(myCloneable == clone);
        System.out.println(myCloneable.getCount() + "::::" + clone.getCount());
        System.out.println(myCloneable.getPerson() + "::::" + clone.getPerson());

        TreeMap map = new TreeMap();
        HashMap a;

    }

}
